/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author usuario
 */
@Embeddable
public class DeportistaCompetenciaPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "idCompetencia")
    private int idCompetencia;
    @Basic(optional = false)
    @NotNull
    @Column(name = "idDeportista")
    private int idDeportista;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "Fase")
    private String fase;

    public DeportistaCompetenciaPK() {
    }

    public DeportistaCompetenciaPK(int idCompetencia, int idDeportista, String fase) {
        this.idCompetencia = idCompetencia;
        this.idDeportista = idDeportista;
        this.fase = fase;
    }

    public int getIdCompetencia() {
        return idCompetencia;
    }

    public void setIdCompetencia(int idCompetencia) {
        this.idCompetencia = idCompetencia;
    }

    public int getIdDeportista() {
        return idDeportista;
    }

    public void setIdDeportista(int idDeportista) {
        this.idDeportista = idDeportista;
    }

    public String getFase() {
        return fase;
    }

    public void setFase(String fase) {
        this.fase = fase;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idCompetencia;
        hash += (int) idDeportista;
        hash += (fase != null ? fase.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DeportistaCompetenciaPK)) {
            return false;
        }
        DeportistaCompetenciaPK other = (DeportistaCompetenciaPK) object;
        if (this.idCompetencia != other.idCompetencia) {
            return false;
        }
        if (this.idDeportista != other.idDeportista) {
            return false;
        }
        if ((this.fase == null && other.fase != null) || (this.fase != null && !this.fase.equals(other.fase))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.DeportistaCompetenciaPK[ idCompetencia=" + idCompetencia + ", idDeportista=" + idDeportista + ", fase=" + fase + " ]";
    }
    
}
